#pragma once
#include <string>
#include <vulkan/vulkan_core.h>
class GfxTexture
{
private:
    std::string _path;
    int _width;
    int _height;
    int _channels;
    VkDeviceSize _imageSize;
    const void *_pixels;

    VkImage _textureImage = VK_NULL_HANDLE;
    VkDeviceMemory _textureImageMemory = VK_NULL_HANDLE;
    VkImageView _textureImageView = VK_NULL_HANDLE;
    VkSampler _textureSampler = VK_NULL_HANDLE;

    void _createTextureImage();
    void _createTextureImageView();
    void _createTextureSampler();

    void _createImage(uint32_t width, uint32_t height, VkFormat format,
                      VkImageTiling tiling, VkImageUsageFlags usage,
                      VkMemoryPropertyFlags properties,
                      VkImage &image, VkDeviceMemory &imageMemory);

public:
    GfxTexture(std::string path);
    GfxTexture(std::string path, const void *pixels, int width, int height, int channels, uint64_t imageSize);

    VkImageView getImageView();
    VkSampler getSampler();
    ~GfxTexture();
};
